home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Demos / A.D. Software / OOFILE / Buildable, limited OOFILE / samples / ooftst15.cpp < prev    next >
C/C++ Source or Header  |  1996-03-25  |  1KB  |  51 lines

  1. // Copyright 1995 A.D. Software. All Rights Reserved
  2.  
  3. // OOFTST15
  4.  
  5. // demonstrates opening two databases sequentially
  6.  
  7. // Simple stream I/O is used to interact with the user.
  8. #include "oofile.hpp"
  9.  
  10. #include "ooftst01.inc"
  11. #include "ooftst02.inc"
  12.  
  13. int main()
  14. {
  15.     cout << "OOFILE Validation Suite - Test 15\n"
  16.          << "Simple test to demonstrate opening two databases" << endl
  17.          << "at different times" << endl;
  18.  
  19.     if (dbConnect::fileExists("ooftst15.db")) {
  20.         theDB.openConnection("ooftst15.db");
  21.     }
  22.     else {
  23.         theDB.newConnection("ooftst15.db");
  24.         Patients.AddTestData();
  25.     }
  26.     
  27.     cout << "Dumping the first database, Patients & Visits" << endl << endl 
  28.          << theDB
  29.          << endl << endl;
  30.     
  31.     theDB.close();
  32.     
  33.     
  34. // now create the second database
  35.     dbConnect_ctree    theDB2;
  36.     dbPeople     People;
  37.  
  38.     if (dbConnect::fileExists("ooftsx15.db")) {
  39.         theDB2.openConnection("ooftsx15.db");
  40.     }
  41.     else {
  42.         theDB2.newConnection("ooftsx15.db");
  43.         People.AddTestData();
  44.     }
  45.         
  46.     cout << "Dumping the second database, People" << endl << endl << theDB2;
  47.     
  48.     cout << "Done" << endl;
  49.     
  50.     return EXIT_SUCCESS;
  51. }